package com.yf.javathread.create;

import java.util.concurrent.*;

public class ThreadTest {


    public static void main(String[] args) throws ExecutionException, InterruptedException, TimeoutException {
        Callable c=new Callable() {
            @Override
            public Object call() throws Exception {
                System.out.println("this is a test callable");
                return 1;
            }
        };
        FutureTask t1=new FutureTask(c);
        System.out.println("**************");
        new Thread(t1).start();

        System.out.println(t1.get(100, TimeUnit.MICROSECONDS));


    }
}
